package br.com.tcc.systemdx.domain;

import java.util.List;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;

@Entity
@Table(name="atributo")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "tipo", discriminatorType = DiscriminatorType.STRING, length = 2)
public abstract class AtributoGenerico extends BaseEntityAssociated<AtributoGenerico> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1087241565584136840L;
	
	protected static class Tipo {
		public static final String SINTOMA = "SI";
		public static final String FATOR_RELEVANTE = "FR";
	}
	
	@NotEmpty
	@Length(max=200)
	private String titulo;
	
	@Lob
	@Length(max=2000)
	private String descricao;
	

	

	public String getTitulo() {
		return titulo;
	}
	
	public void setTitulo(String titulo) {
		this.titulo = titulo;
	}
	
	public String getDescricao() {
		return descricao;
	}
	
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}
	
	public abstract String getTipo();
	
	public boolean isFilho() {
		return (getParent() != null);
	}
}
